#include "vebi.h"
int main(int argc, char *argv[])
{
VideoCapture capture;
Vebi vb;
Mat frame,gray,mask;
capture.open(0);
capture.set(CV_CAP_PROP_FRAME_WIDTH,800);
capture.set(CV_CAP_PROP_FRAME_HEIGHT,600);
if(!capture.isOpened()){
    cout<<"capture not open"<<endl;
    capture.release();
}
bool first=true;
while(1){
    capture>>frame;
    if(frame.empty())continue;
    cvtColor(frame,gray,CV_RGB2GRAY);
    if(first){
            vb.executeFirstFrame(gray);
            first=false;
    }else{
        vb.checkandUpdate(gray);
        mask=vb.getMask();
        imshow("vedio",mask);
    }
waitKey(10);

}

    return 0;
}
